# coding=utf-8
import random

# help(random)
rand = random.Random()

def swap(li:list,fromindex:int,toindex:int):
	tmp = li[fromindex]
	li[fromindex] = li[toindex]
	li[toindex] = tmp

def shuffle(src:list):
	# 从头开始和后面的随机位置交换值
	for i in range(len(src)-1):
		index2swap =  rand.randint(i+1,len(src)-1)
		swap(src,i,index2swap)
	return src

if __name__ == '__main__':
	srclist=[1,2,3,4,5,6,7,8,9]
	srclist = list('helloworld')
	shuffle(srclist)
	print(''.join(srclist))
